package com.gxa.service.impl;

import com.gxa.common.R;
import com.gxa.common.vo.PatientReportVo;
import com.gxa.mapper.PatientReportMapper;
import com.gxa.service.PatientReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientReportServiceImpl implements PatientReportService {

    @Autowired
    PatientReportMapper patientReportMapper;

    /**
     * 查找患者报表信息
     * @return
     */
    @Override
    public List getPatientReportList() {

        List<PatientReportVo> patientReportVos = patientReportMapper.selectPatientReportList();

        return patientReportVos;
    }

    /**
     * 查找患者区域
     * @return
     */
    @Override
    public List getPatientReportArea() {

        List list = patientReportMapper.selectPatientReportArea();

        return list;
    }

    /**
     * 查找患者跟进信息
     * @return
     */
    @Override
    public List getPatientReportFollow() {

        List list = patientReportMapper.selectPatientReportFollow();

        return list;
    }

    @Override
    public R getYearReport() {

        R r = new R();

        List list = patientReportMapper.selectYearReport();

        if (list.size() > 0) {

            r.setCode(200);

            r.setMsg("success");

            r.setData(list);
        }

        return r;
    }
}
